home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / mathstud.zip / GABOR.M < prev    next >
Text File  |  1994-01-23  |  967b  |  38 lines

  1. %Demonstartion of a linear FM radar Gabor (time/frequency) transform
  2. %The variable wave is the analytic linear FM radar signal which
  3. %you can change to get the transform of other waveforms
  4. %can be changed to an M-file function
  5.  
  6. %       S.Halevy 7/31/92
  7. %       Copyright (c) 1992 by the MathWizards
  8.  
  9. clear
  10. gwsel(0)
  11. n=16
  12. n2=n+n;
  13. t=(0:n-1)/n;
  14. f0=1;
  15. f1=4;
  16. arg=2*pi*f0*t.*(1+0.5*(f1-f0)*t);
  17. wave0=sin(arg)+cos(arg)*1J;
  18. wave = [zeros(wave0) wave0];
  19. gabor=[]
  20. for k=1:n2
  21.   k
  22.   sig=wave.*conj(fliplr(wave)<>[0 k]);
  23.   siga=abs(fft(sig));
  24.   gabor=[gabor siga'];
  25. end
  26. save gabor gabor
  27.  
  28. load gabor
  29. gabor /= max(max(gabor));
  30. mesh(gabor)
  31. subplot(211)
  32. plot(t,real(wave0)), xlabel('time'), ylabel('amp'), title('signal')
  33. contour(flipud(gabor)),grid,xlabel('time'),ylabel('frequency'),title('Gabor Transform') 
  34. subplot
  35. threshold=0.95*ones(n2,1)*max(gabor);
  36. % the time-frequency distribution (threshold detection)
  37. contour(flipud(gabor>threshold),4)
  38.